package com.alibaba.citrus.ots.sales.plan.model;

import java.util.Arrays;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-07 11:03
 */
public enum SalesPlanReportAuditStatusEnum {
    /**
     * 待提交
     */
    TO_BE_REVIEW(1, "待提交"),

    /**
     * 审核中
     */
    UNDER_REVIEW(2, "审核中"),

    /**
     * 审核通过
     */
    APPROVED(3, "审核通过"),

    /**
     * 审核驳回
     */
    REVIEW_REJECTED(4, "审核驳回");

    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    SalesPlanReportAuditStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SalesPlanReportAuditStatusEnum of(Integer code) {
        return Arrays.stream(SalesPlanReportAuditStatusEnum.values()).filter(source -> code == source.code).findFirst().orElse(null);
    }
}
